1. Field of the Invention
The present invention relates in general to hosting graphics processing at a centralized location for remote users, and more particularly to recreating graphics processing unit state information associated with a migrated virtual machine.
2. Description of the Related Art
The migration of a virtual machine (VM) is an integral capability within virtualized environments, enabling load-balancing, support for fail-over, and efficient use of heterogeneous physical resources. When a VM is migrated, its state in the current environment is captured, saved, transferred, and then recreated in the new environment. This process is simple when the VM is isolated from the underlying physical properties of the VM host. However, with device assignment capabilities, such as those realized by the implementation of an input/output (I/O) memory management unit (IOMMU), I/O devices coupled to the VM host can be controlled directly by the VM.
This ability leads to a number of challenges. For example, the state of the assigned device, such as a graphics device comprising a GPU, must be captured correctly. When operating a GPU, a current state and context of a GPU is commonly comprehended as a disjoint set of internal registers, Z buffer contexts, frame buffer contents and texture map storage buffers. Context switching within a single operating system image involves a number of serial steps orchestrated by the operation system. The GPU may autonomously save and restore internal state and notify the operating system when the operation is completed. However, if one or more GPUs are to be shared efficiently among multiple applications executing under multiple virtual machines, each executing a graphically oriented operating system and perhaps generating composited graphics on separate thin clients (such as in a hosted graphics environment), migrating a GPU context can be challenging.
Moreover, this issue becomes more challenging when migrating a VM between physical VM hosts. In particular, the captured state of the GPU must be visible to the current VMM so it can be transferred correctly through the receiving VMM to a new assigned device, such as a heterogeneous graphics device coupled to the target VM host. In addition, the software running in the migrated VM must work properly with the new assigned device in the new environment. These issues become even more challenging when the two assigned devices maintain their internal state in different formats. In the case of graphics devices comprising a GPU, context information can be very large and are typically stored in a native format that is incompatible with other GPUs. As a result, VM migrations involving GPU state information can prove difficult and sometimes impossible.